<?php
/**
 * Post model
 *
 * @property int $id
 * @property string $title
 * @property string $html_content
 * @property \ActiveRecord\DateTime $created_at
 * @property \ActiveRecord\DateTime $updated_at
 * @property int $profile_id
 * @property int $status_id
 * @property Profile $profile
 * @property array $comments
 * @property PostStatus $status
 * @property array $tags
 */
class Post extends MModel {

    static $table_name = 'ml_blog_posts';
    static $belongs_to = array(
        array('ml_blog_profiles', 'class_name' => 'Profile'),
        array('ml_blog_posts_status', 'class_name' => 'PostStatus'),
    );
    static $has_many = array(
        array('ml_blog_comments', 'class_name' => 'Comment'),
        array('ml_blog_posts_tags', 'class_name' => 'PostTag'),
        array('ml_blog_posts_categories', 'class_name' => 'PostCategory'),
        array('ml_blog_tags', 'through' => 'ml_blog_posts_tags', 'source' => 'Tag'),
        array('ml_blog_categories', 'through' => 'ml_blog_posts_categories', 'source' => 'Category')
    );
    static $alias_attribute = array(
        'profile' => 'ml_blog_profiles',
        'comments' => 'ml_blog_comments',
        'status' => 'ml_blog_posts_status',
        'tags' => 'ml_blog_tags',
    );

}

?>
